Repository navigation
fix(spec): unlock the archive lock before its file closes - #91
runewright[bot] wants to merge 1 commit into
Conversation
The transaction held the archive lock as a plain File and released it only by closing the file. The lock is a flock on the open file description, so a child process that another thread spawned while the lock was held kept a copy of the descriptor until it exec-ed or exited, and the lock with it. An immediate retry then failed with "another spec archive transaction holds" the lock: spec::tests::archive_retry_reports_the_existing_dated_archive failed that way on the cli 84 Test job, because rune-docs unit tests run as threads of one process and the doctor tests spawn children. HeldLock unlocks in Drop before the close, for the transaction and for the doctor probe. A new test holds a duplicate descriptor, drops the transaction, and takes the lock again; it fails with the CI error without the unlock. In a stress loop with four spawning threads, 26 of 2000 retries failed before the change and 0 of 2000 after. Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
|
review/correctness round 1 started on |
|
Claude finished @Runewright[bot]'s task in 3m 4s —— View job Correctness review
Looks good. Verified:
Minor, non-blocking:
I could not run |
Runeseer review — cleanLooks good.
No open findings · Reviewed |
Draft for
change/archive-lock-release: the session agent fills this body beforerune sign open.Plan
Why this shape, one or two sentences.
Changes
Testing
Release Notes
Note
Unlock spec archive lock before its file closes
HeldLockguard in mod.rs that wraps the lock file and explicitly unlocks it onDrop, before the descriptor closes. This fixes retries that fail when a child process holds a copied descriptor, since a close alone does not release the lock in that case.Transactionnow stores aHeldLockinstead of aFile, andacquire_with_io,health_findings, andincomplete_transaction_findingsall use the guard, including on early returns.Macroscope summarized 8521a5e.